import Vue from 'vue'
import Component from 'vue-class-component'
import BlankIcon from '@/assets/images/blankIcon.png'

@Component({
  props: {
    show: Boolean
  }
})

export default class BlankPageClass extends Vue {
  wrapperHeight = 0

  get caculateHeight() {
    return 'height:' + String(this.wrapperHeight) + 'px'
  }

  created() {
    this.wrapperHeight = document.documentElement.clientHeight

    if (!this.show) {
      this.show = false
    }
  }

  handleRefresh () {
    this.$emit('refresh')
  }

  render () {
    return (
        <div class="noData">
          <dt><img slot="icon" src={BlankIcon}/></dt>
          <dd>
            暂无数据
          </dd>
          <input type="button" value="重新加载" onClick = {this.handleRefresh}/>
        </div>
    )
  }
}
